﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class Developer_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        // connection
        SqlConnection con = new System.Data.SqlClient.SqlConnection();
        con.ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=\"C:\\Users\\yuix\\Documents\\Visual Studio 2010\\WebSites\\WebSite1\\App_Data\\mmcinfo.mdf\";Integrated Security=True;Connect Timeout=30;User Instance=True";

        try
        {
            // open connection
            con.Open();
            SqlCommand cmd = new SqlCommand("SELECT * FROM Security", con);
            // call execute reader to get query results
            SqlDataReader rdr = cmd.ExecuteReader();
        }
        finally
        {
            // close the connection
            if (con != null)
            {
                con.Close();
            }
        } 
    }
}